package com.smartum.mpr.json.deserializers;

import java.io.IOException;

import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.DeserializationContext;
import org.codehaus.jackson.map.JsonDeserializer;

import com.smartum.mpr.model.ItemType;

public class ItemTypeDeserializer extends JsonDeserializer<ItemType> {

	@Override
	public ItemType deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
		return ItemType.getItemTypeById(jp.getIntValue());
	}

}
